<template>
	<view class="empty-container" :style="{padding:paddingNum+'px'}">
		<view class="empty-line" ref="left-line-dom">
			
		</view>
		
		<view class="empty-words" v-if="isHasWords">
			<slot>
				<view>
					暂无数据
				</view>
				<view>
					请在右上角添加
				</view>
			</slot>
		</view>
		
		<view class="empty-line" ref="right-line-dom">
			
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				paddingNum:0
			}
		},
		created() {
			this.paddingNum = this.rpx2px(this.padding);
		},
		mounted() {
			
		},
		methods:{
			rpx2px(num){
				return uni.upx2px(num)
			}
		},
		props: {
			isHasWords: {
				type: Boolean,
				default: true
			},
			
			padding: {
				type: Number,
				default: 0
			},
		
		}
	}
</script>

<style scoped>
	.empty-container{
		display: flex;
		font-size: 14px;
		align-items: center;
	}
	.empty-line{
		width: 100%;
		height: 1px;
		background-color: #ddd;
	}
	.empty-words{
		flex-shrink: 0;
		text-align: center;
		color: #909399;
		font-size: 12px;
		padding: 0 20rpx;
	}
</style>
